home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 2.6 KB | 84 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: ClockFac.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Lonnie Millett
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef CLOCKFAC_H
- #define CLOCKFAC_H
-
- // ----- Framework Includes -----
-
- #ifndef FWFACET_H
- #include <FWFacet.h>
- #endif
-
- // ----- Graphic Includes -----
-
- #ifndef FWRECT_H
- #include <FWRect.h>
- #endif
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- class CClockFacet;
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- class XMPFacet;
- class XMPShape;
- class CClockFrame;
- class XMPDragItemIterator;
-
- //==============================================================================
- // CClockFacet
- //==============================================================================
-
- class CClockFacet : public FW_CFacet
- {
- public:
- CClockFacet();
- virtual ~CClockFacet();
- void InitClockFacet(XMPFacet* xmpFacet, CClockFrame* clockFrame);
-
- CClockFrame* GetClockFrame();
-
- virtual void Draw(FW_CGraphicContext *gc);
-
- virtual void DragEnter(XMPDragItemIterator* dragInfo, const FW_CPoint& where);
-
- void UpdateAnalogClock(FW_CGraphicContext *gc, unsigned long tickCount);
- void UpdateDigitalClock(FW_CGraphicContext *gc, unsigned long tickCount);
-
- private:
- void CalcPoint(FW_CPoint* point, XMPCoordinate radius, const XMPPoint& center, const FW_CRect& frame, Fixed angle);
- void DrawClockFace(FW_CGraphicContext *gc);
- void DrawClockHands(FW_CGraphicContext *gc, unsigned long tickCount);
- void DrawHourHand(FW_CGraphicContext *gc, const FW_CRect& clockRect, const FW_CPoint& centerPoint, Fixed hour, Fixed minute);
- void DrawMinuteHand(FW_CGraphicContext *gc, const FW_CRect& clockRect, const FW_CPoint& centerPoint, Fixed minute);
- void DrawSecondHand(FW_CGraphicContext *gc, const FW_CRect& clockRect, const FW_CPoint& centerPoint, Fixed second);
-
- private:
- CClockFrame* fClockFrame;
- };
-
- //----------------------------------------------------------------------------------------
- // CClockFacet::GetClockFrame()
- //----------------------------------------------------------------------------------------
- inline CClockFrame* CClockFacet::GetClockFrame()
- {
- return fClockFrame;
- }
-
- #endif
-